<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #d1{
            width: 100px;
            height:100px;
            background: red;
            margin-left: 25px;
            margin-top: 25px;
            overflow: hidden;
        }

        div>div{
            width: 50px;
            height: 50px;
            background: blue;
           margin-top: 25px;
            margin-left: 25px;
        }

        #d2{
            width: 50px;
            height: 50px;
            border: 3px solid green;
            border-radius: 4px;
            margin-left: 125px;

            /*给元素添加内边距会影响元素的宽高*/
            padding-left: 50px;
            padding-top: 50px;

        }


    </style>
</head>
<body>

<div id="d1"><div></div></div>
<div id="d2">哈喽</div>

</body>
</html>